package com.ricchieri.dao;

import java.util.List;

import org.hibernate.Criteria;

import com.ricchieri.dao.interf.IExpenseDao;
import com.ricchieri.filter.BasicFilter;
import com.ricchieri.model.Expense;

public class ExpenseDao extends GenericDao implements IExpenseDao {
	private static final long serialVersionUID = 651011627528925809L;

	@Override
	@SuppressWarnings("unchecked")
	public List<Expense> getAllExpense(BasicFilter filter) {
		Criteria criteria = criteriaAllExpense(filter);
		
		return criteria.list();
	}
	
	private Criteria criteriaAllExpense(BasicFilter filter) {
		return super.criteriaAllBasic(filter, Expense.class);
	}	
	
	@Override
	protected String getTableName() {
		return "expense";
	}
}
